﻿<SplitContainer Top="8" Left="8" Width="650" Height="500"
                Anchor="@(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)"
                Orientation="System.Windows.Forms.Orientation.Vertical"
                SplitterDistance="350">
    <Panel1>
        <Label Top="8" Left="8" Text="Todo Items" />
        <Panel Top="40" Left="8" Width="350" Height="450" BackColor="SystemColors.ControlDark">
            <TodoList />
        </Panel>
    </Panel1>
    <Panel2>
        <Label Top="8" Left="8" Text="Counter" />
        <Panel Top="40" Left="8">
            <Button Text="Toggle counter" OnClick="@ToggleCounterVisible" />
            @if (isCounterVisible)
            {
                <Panel Top="50" Width="200" Height="100">
                    <Counter />
                </Panel>
            }
        </Panel>
    </Panel2>
</SplitContainer>

@code
{
    bool isCounterVisible = true;

    void ToggleCounterVisible()
    {
        isCounterVisible = !isCounterVisible;
    }
}
